package com.finance.cooperate.strategy.config;

import com.finance.cooperate.strategy.core.common.ConfigureProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName ConfigureProcessorBeanConfig
 * @Description 默认是测试环境
 * @Author shenanxin
 * @Date 2023/8/24 16:10
 * @Modify ...
 */
@Configuration
public class ConfigureProcessorBeanConfig {

    @Bean("strategyConfig")
    @ConditionalOnProperty(prefix = "coo.mexico.strategy", name = "config", havingValue = "prod", matchIfMissing = true)
    public ConfigureProcessor strategyConfig() {
        return new StrategyConfig();
    }

    @Bean("strategyConfig")
    @ConditionalOnProperty(prefix = "coo.mexico.strategy", name = "config", havingValue = "test")
    public ConfigureProcessor strategyTestConfig() {
        return new StrategyTestConfig();
    }


}
